package com.accesshollywood.viewFiltering;

import com.accesshollywood.indexables.Indexed;

public class ViewFilterTemplate extends Indexed{
//	public int				idViewFilter;
	public ViewFilterGroup	viewFilterGroup;
	public String			filterName;
	public String			whereCondition;

	public ViewFilterTemplate(int id, String name, String where) {
		//idViewFilter = id;
		setId(id);
		filterName = name;
		whereCondition = where;
	}


	@Override
	public void initSQL() {
		// TODO Auto-generated method stub
		
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((filterName == null) ? 0 : filterName.hashCode());
		result = prime * result + ((viewFilterGroup == null) ? 0 : viewFilterGroup.hashCode());
		result = prime * result + ((whereCondition == null) ? 0 : whereCondition.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ViewFilterTemplate other = (ViewFilterTemplate) obj;
		if (filterName == null) {
			if (other.filterName != null)
				return false;
		} else if (!filterName.equals(other.filterName))
			return false;
		if (viewFilterGroup == null) {
			if (other.viewFilterGroup != null)
				return false;
		} else if (!viewFilterGroup.equals(other.viewFilterGroup))
			return false;
		if (whereCondition == null) {
			if (other.whereCondition != null)
				return false;
		} else if (!whereCondition.equals(other.whereCondition))
			return false;
		return true;
	}
}
